﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataStructures
{
	public class TreeVisitor<Tree> : ITreeVisitor<Tree>
	{
		public void Visit(Tree tree)
		{
			throw new NotImplementedException();
		}
	}
	public class BuildTreeListVisitor<Tree> : ITreeVisitor<Tree>
	{
		public BuildTreeListVisitor(List<Tree> list) { _List = list; }
		public void Visit(Tree tree) { _List.Add(tree); }
		private List<Tree> _List;
	}
	public class BuildElementListVisitor<Element, Tree, TreeList> : ITreeVisitor<Tree>
		where Tree : IBaseTree<Element, Tree, TreeList>
		where TreeList : IBaseTreeList<Element, Tree, TreeList>
	{
		public BuildElementListVisitor(List<Element> list) { _List = list; }
		public void Visit(Tree tree) { _List.Add(tree.Value); }
		private List<Element> _List;
	}
}
